<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>

<div name="ti"></div>
<div name="ti"></div>
<div name="ti"></div>

</body>
<script>

    //按标签的name值来获取对象，返回数组
    let arr = document.getElementsByName('t1');
    console.log(arr.length)
</script>
</html>